﻿using BaseUI;
using BLL;
using System;
using System.Data;
using System.Web.UI;

namespace Thksoft.BusinessExpansion.Process
{
    public partial class Business_Plans : BasePage
    {
        private Qs_BusinessBLL qbb = new Qs_BusinessBLL();

        protected void Page_Load(object sender, EventArgs e)
        {
            string bid = Request.QueryString["N_business_id"].ToString();
            GetData(bid);
        }

        private void GetData(string id)
        {
            DataTable dt = qbb.getBussinessById(id);

            if (dt == null || dt.Rows.Count <= 0)
            {
                MessageBox.Show(Page, "业务流程有误！");
                return;
            }

            Label1.Text = dt.Rows[0]["业务名称"].ToString();

            if (dt.Rows[0]["n_process_id"].ToString() == "121")
            {
                Control trol = Page.LoadControl("../../UserCotrols/CtrlYearFundsMX.ascx");
                PlaceHolder3.Controls.Add(trol);  //加载申请明细信息控件
            }
            else if (dt.Rows[0]["n_process_id"].ToString() == "51")
            {
                Control trol = Page.LoadControl("../../UserCotrols/CtrlMonthFundMX.ascx");
                PlaceHolder3.Controls.Add(trol);  //加载申请明细信息控件
            }
            else if (dt.Rows[0]["n_process_id"].ToString() == "50")
            {
                Control trol = Page.LoadControl("../../UserCotrols/CtrlWeekFundsMX.ascx");
                PlaceHolder3.Controls.Add(trol);  //加载申请明细信息控件
            }
        }

        protected void btnDaoChu_Click(object sender, EventArgs e)
        {
            toExecl1(Panel1, Label1.Text);
        }
    }
}